Optimal. Leaf size=24 \[ -\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3738, 4209, 65,
213} \begin {gather*} -\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 213
Rule 3738
Rule 4209
Rubi steps
\begin {align*} \int \cot (x) \sqrt {a+a \tan ^2(x)} \, dx &=\int \cot (x) \sqrt {a \sec ^2(x)} \, dx\\ &=\frac {1}{2} a \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a x}} \, dx,x,\sec ^2(x)\right )\\ &=\text {Subst}\left (\int \frac {1}{-1+\frac {x^2}{a}} \, dx,x,\sqrt {a \sec ^2(x)}\right )\\ &=-\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 30, normalized size = 1.25 \begin {gather*} \cos (x) \left (-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \sqrt {a \sec ^2(x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 23, normalized size = 0.96
method | result | size |
default | \(\cos \left (x \right ) \sqrt {\frac {a}{\cos \left (x \right )^{2}}}\, \ln \left (-\frac {-1+\cos \left (x \right )}{\sin \left (x \right )}\right )\) | \(23\) |
risch | \(-2 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+1\right ) \cos \left (x \right )+2 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-1\right ) \cos \left (x \right )\) | \(62\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 38 vs.
\(2 (18) = 36\).
time = 0.56, size = 38, normalized size = 1.58 \begin {gather*} -\frac {1}{2} \, \sqrt {a} {\left (\log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.21, size = 63, normalized size = 2.62 \begin {gather*} \left [\frac {1}{2} \, \sqrt {a} \log \left (\frac {a \tan \left (x\right )^{2} - 2 \, \sqrt {a \tan \left (x\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (x\right )^{2}}\right ), \sqrt {-a} \arctan \left (\frac {\sqrt {a \tan \left (x\right )^{2} + a} \sqrt {-a}}{a}\right )\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\tan ^{2}{\left (x \right )} + 1\right )} \cot {\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 24, normalized size = 1.00 \begin {gather*} \frac {a \arctan \left (\frac {\sqrt {a \tan \left (x\right )^{2} + a}}{\sqrt {-a}}\right )}{\sqrt {-a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.18, size = 12, normalized size = 0.50 \begin {gather*} -\sqrt {a}\,\mathrm {atanh}\left (\sqrt {\frac {1}{{\cos \left (x\right )}^2}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________